<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title><?= trans('title_main') ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="author" content="Beforever" />
    <meta name="application-name" content="Beforever admin center panel" />

    <!-- Headings -->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,800,700' rel='stylesheet' type='text/css'>
    <!-- Text -->
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css' />

    <!--[if lt IE 9]>
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400" rel="stylesheet" type="text/css" />
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:700" rel="stylesheet" type="text/css" />
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:800" rel="stylesheet" type="text/css" />
    <link href="http://fonts.googleapis.com/css?family=Droid+Sans:400" rel="stylesheet" type="text/css" />
    <link href="http://fonts.googleapis.com/css?family=Droid+Sans:700" rel="stylesheet" type="text/css" />
    <![endif]-->

    <!-- Core stylesheets do not remove -->
    <link href="<?= template_admincp_url() ?>css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>css/bootstrap/bootstrap-theme.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>css/icons.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>css/genyx-theme/jquery.ui.genyx.css" rel="stylesheet" />

    <!-- Plugins stylesheets -->
    <link href="<?= template_admincp_url() ?>js/plugins/misc/fullcalendar/fullcalendar.css" rel="stylesheet" /> 
    <link href="<?= template_admincp_url() ?>js/plugins/ui/jgrowl/jquery.jgrowl.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>js/plugins/tables/datatables/jquery.dataTables.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>js/plugins/forms/uniform/uniform.default.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>js/plugins/forms/switch/bootstrapSwitch.css" rel="stylesheet" /> 
    <link href="<?= template_admincp_url() ?>js/plugins/forms/spectrum/spectrum.css" rel="stylesheet" /> 
    <link href="<?= template_admincp_url() ?>js/plugins/forms/datepicker/datepicker.css" rel="stylesheet" /> 
    <link href="<?= template_admincp_url() ?>js/plugins/forms/select2/select2.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>js/plugins/forms/multiselect/ui.multiselect.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>css/dropbox.css" rel="stylesheet" />
    <link href="<?= template_admincp_url() ?>js/plugins/upload/elfinder/elfinder.min.css" rel="stylesheet" />

    <!-- app stylesheets -->
    <link href="<?= template_admincp_url() ?>css/app.css" rel="stylesheet" /> 

    <!-- Custom stylesheets ( Put your own changes here ) -->
    <link href="<?= template_admincp_url() ?>css/custom.css" rel="stylesheet" /> 

    <!--[if IE 8]><link href="<?= template_admincp_url() ?>css/ie8.css" rel="stylesheet" type="text/css" /><![endif]-->

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="<?= template_admincp_url() ?>js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?= template_admincp_url() ?>images/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?= template_admincp_url() ?>images/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?= template_admincp_url() ?>images/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="<?= template_admincp_url() ?>images/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="<?= template_admincp_url() ?>images/ico/favicon.html">
    <!-- Le javascript
    ================================================== -->
    <!-- Important plugins put in all pages -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
	<script src="<?= template_admincp_url() ?>js/jquery.timeago.js"></script>
	<script src="<?= template_admincp_url() ?>js/socket.io.js"></script>
	<script src="<?= template_admincp_url() ?>js/mootools-core-1.4.5.js"></script>
	<script src="<?= template_admincp_url() ?>js/mootools-more-1.4.0.1.js"></script>
	<script src="<?= template_admincp_url() ?>js/jquery.base64.js"></script>
    <script src="<?= template_admincp_url() ?>js/conditionizr.min.js"></script>  
    <script src="<?= template_admincp_url() ?>js/bootstrap/bootstrap.js"></script> 
    <script src="<?= template_admincp_url() ?>js/plugins/core/nicescroll/jquery.nicescroll.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/core/jrespond/jRespond.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/highcharts.js"></script>
    <script src="<?= template_admincp_url() ?>js/exporting.js"></script>
    <script src="<?= template_admincp_url() ?>js/bootbox.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/jquery.mousewheel.js"></script>
    <script src="<?= template_admincp_url() ?>js/messi.js"></script>

    <!-- Charts plugins -->
    <script src="<?= template_admincp_url() ?>js/plugins/charts/flot/jquery.flot.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/flot/jquery.flot.pie.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/flot/jquery.flot.resize.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/flot/jquery.flot.tooltip.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/flot/jquery.flot.orderBars.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/flot/jquery.flot.time.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/sparklines/jquery.sparkline.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/flot/date.js"></script> <!-- Only for generating random data delete in production site-->
    <script src="<?= template_admincp_url() ?>js/plugins/charts/pie-chart/jquery.easy-pie-chart.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/gauge/justgage.1.0.1.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/charts/gauge/raphael.2.1.0.min.js"></script>

    <!-- Form plugins -->
    <script src="<?= template_admincp_url() ?>js/plugins/forms/uniform/jquery.uniform.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/validation/jquery.validate.js"></script>
	<script src="<?= template_admincp_url() ?>js/plugins/forms/validation/jquery.validate.file.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/validation/additional-methods.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/validation/messages_vi.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/select2/select2.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/autosize/jquery.autosize-min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/inputlimit/jquery.inputlimiter.1.3.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/mask/jquery.mask.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/switch/bootstrapSwitch.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/globalize/globalize.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/spectrum/spectrum.js"></script><!--  Color picker -->
    <script src="<?= template_admincp_url() ?>js/plugins/forms/datepicker/bootstrap-datepicker.js"></script> 
    <script src="<?= template_admincp_url() ?>js/plugins/forms/multiselect/ui.multiselect.js"></script>
    <script src="<?= template_admincp_url() ?>js/plugins/forms/tinymce/tinymce.min.js"></script>

    <!-- Misc plugins -->
    <script src="<?= template_admincp_url() ?>js/plugins/misc/fullcalendar/fullcalendar.min.js"></script>
    <script src="<?= template_admincp_url() ?>js/jquery.filedrop.js"></script>

    <!-- UI plugins -->
    <script src="<?= template_admincp_url() ?>js/plugins/ui/jgrowl/jquery.jgrowl.min.js"></script>

    <!-- Tables plugins -->
    <script src="<?= template_admincp_url() ?>js/plugins/tables/datatables/jquery.dataTables.min.js"></script>  

    <!-- Upload plugins -->
    <script src="<?= template_admincp_url() ?>js/plugins/upload/elfinder/elfinder.min.js"></script>

    <!-- Define -->
	<?php
		$module = $this->router->fetch_module();
		$controller = $this->router->fetch_class();
		$action = $this->router->fetch_method();
	?>
	<script type="text/javascript">
	    var $base_url='<?= base_url(); ?>';
	    var $admincp_url='<?= admincp_url() ?>';
	    var $template_admincp_url='<?= template_admincp_url() ?>';
	    var $app={
			'module':'<?= $module ?>',
	        'controller':'<?= $controller ?>',
	        'action':'<?= $action ?>'
		};
	</script>

  </head>
  <body>
    <header id="header">
        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
            <a class="navbar-brand" href="<?= admincp_url() ?>"><img src="<?= template_admincp_url().'images/logo.png' ?>" style="width:200px" /></a>
            <button type="button" class="navbar-toggle btn-danger" data-toggle="collapse" data-target=".navbar-to-collapse">
                <span class="sr-only">Toggle right menu</span>
                <i class="icon16 i-arrow-8"></i>
            </button>
            <!-- <div id="top-search">
                <form action="#" method="post" class="form-search">
                    <div class="input-group">
                        <input type="text" name="tsearch" id="tsearch" placeholder="Search here ..." class="search-query">
                        <button type="submit" class="btn"><i class="icon16 i-search-2 gap-right0"></i></button>
                    </div>
                </form>
            </div> -->
            <!-- <div class="collapse navbar-collapse navbar-to-collapse">    
                <ul class="nav navbar-nav pull-right">
                    <li class="divider-vertical"></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon24 i-bell-2"></i>
                            <span class="notification red">6</span>
                        </a>
                        <ul class="dropdown-menu" role="menu">
                            <li role="presentation"><a href="#" class=""><i class="icon16 i-calendar-2"></i> Admin Jenny add event</a></li>
                            <li role="presentation"><a href="#" class=""><i class="icon16 i-file-zip"></i> User Dexter attach file</a></li>
                            <li role="presentation"><a href="#" class=""><i class="icon16 i-stack-picture"></i> User Dexter attach 3 pictures</a></li>
                            <li role="presentation"><a href="#" class=""><i class="icon16 i-cart-add"></i> New orders <span class="notification green">2</span></a></li>
                            <li role="presentation"><a href="#" class=""><i class="icon16 i-bubbles-2"></i> New comments <span class="notification red">5</span></a></li>
                            <li role="presentation"><a href="#" class=""><i class="icon16 i-pie-5"></i> Daily stats is generated</a></li>
                        </ul>
                    </li>
                    <li class="divider-vertical"></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon24 i-envelop-2"></i>
                            <span class="notification red">3</span>
                        </a>
                        <ul class="dropdown-menu messages" role="menu">
                            <li class="head" role="presentation">
                                <h4>Inbox</h4>
                                <span class="count">3 messages</span>
                                <span class="new-msg"><a href="#" class="tipB" title="Write message"><i class="icon16 i-pencil-5"></i></a></span>
                            </li>
                            <li role="presentation">
                                <a href="#" class="clearfix">
                                    <span class="avatar"><img src="images/avatars/peter.jpg" alt="avatar"></span>
                                    <span class="msg">Call me i need to talk with you</span>
                                    <button class="btn close"><i class="icon12 i-close-2"></i></button>
                                </a>
                            </li>
                            <li role="presentation">
                                <a href="#" class="clearfix">
                                    <span class="avatar"><img src="images/avatars/milen.jpg" alt="avatar"></span>
                                    <span class="msg">Problem with registration</span>
                                    <button class="btn close"><i class="icon12 i-close-2"></i></button>
                                </a>
                            </li>
                            <li role="presentation">
                                <a href="#" class="clearfix">
                                    <span class="avatar"><img src="images/avatars/anonime.jpg" alt="avatar"></span>
                                    <span class="msg">I have question about ...</span>
                                    <button class="btn close"><i class="icon12 i-close-2"></i></button>
                                </a>
                            </li>
                            <li class="foot" role="presentation"><a href="email.html">View all messages</a></li>
                        </ul>
                    </li>
                    <li class="divider-vertical"></li>
                </ul>
            </div> -->
        </nav>
    </header> <!-- End #header  -->
    
    <div class="main">
        
        <?= $this->load->view('admincp/sidebar') ?>

        <section id="content">
            <div class="wrapper">
                <div class="crumb">
                    <?= $this->breadcrumb->output() ?>
                </div>
                
                <div class="container-fluid">                    
                    <div id="heading" class="page-header">
                        <h1><?= $title_page ?></h1>
                    </div>
                    <?php if(isset($template)) $this->load->view($template) ?>                    

                </div> <!-- End .container-fluid  -->
            </div> <!-- End .wrapper  -->
        </section>
    </div><!-- End .main  -->
    <?php
        $typeNoti = '';
        $dataNoti = '';
		if($this->session->flashdata('login') != ''){
            $typeNoti = 'login';
            $dataNoti = $this->session->flashdata('login');
        }
        if($this->session->flashdata('success') != ''){
            $typeNoti = 'success';
            $dataNoti = $this->session->flashdata('success');
        }
        if($this->session->flashdata('warning') != ''){
            $typeNoti = 'warning';
            $dataNoti = $this->session->flashdata('warning');
        }
    ?>
    <script type="text/javascript">
        $(document).ready(function() {
            var typeNoti = "<?= $typeNoti ?>";
            var dataNoti = "<?= $dataNoti ?>";
            switch(typeNoti){
				case "login": 
                    $.jGrowl("<i class='icon16 i-checkmark-3'></i> "+dataNoti, {
			    		group: 'success',
			    		position: 'center',
			    		sticky: false,
			    		closeTemplate: '<i class="icon16 i-close-2"></i>',
			    		animateOpen: {
					        width: 'show',
					        height: 'show'
					    }
			    	});
                break;
                case "success": 
                    $.jGrowl("<i class='icon16 i-checkmark-3'></i> "+dataNoti, {
                        group: 'success',
                        closeTemplate: '<i class="icon16 i-close-2"></i>',
                        animateOpen: {
                            width: 'show',
                            height: 'show'
                        }
                    });
                break;
                case "warning": 
                    $.jGrowl("<i class='icon16 i-warning-2'></i> "+dataNoti, {
                        group: 'warning',
                        closeTemplate: '<i class="icon16 i-close-2"></i>',
                        animateOpen: {
                            width: 'show',
                            height: 'show'
                        }
                    });
                break;
                default:
                break;
            }
        });
    </script>
    <script data-main="<?= base_url() ?>assets/apps/backend/main" src="<?= base_url() ?>assets/bundles/require.js"></script>
  </body>
</html>